package org.iabako.shared.dto;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by jose on 12/11/14.
 */
public class FinancesBalance implements Serializable {

    private Double salesPayed;
    private Double expensesPayed;

    private Double salesReceivable;
    private Double expensesPayable;

    private Date financeBalanceDate;

    public FinancesBalance() {
    }

    public FinancesBalance(Double salesPayed, Double salesReceivable, Double expensesPayed, Double expensesPayable) {
        this.salesPayed = salesPayed;
        this.salesReceivable = salesReceivable;
        this.expensesPayed = expensesPayed;
        this.expensesPayable = expensesPayable;
    }

    public Double getSalesPayed() {
        if (salesPayed == null) {
            salesPayed = 0D;
        }
        return salesPayed;
    }

    public Double getExpensesPayed() {
        if (expensesPayed == null) {
            expensesPayed = 0D;
        }
        return expensesPayed;
    }

    public Double getSalesReceivable() {
        if (salesReceivable == null) {
            salesReceivable = 0D;
        }
        return salesReceivable;
    }

    public Double getExpensesPayable() {
        if (expensesPayable == null) {
            expensesPayable = 0D;
        }
        return expensesPayable;
    }

    public void addSalesPayed(Double salesPayed) {
        this.salesPayed = getSalesPayed() + salesPayed;
    }

    public void addExpensesPayed(Double expensesPayed) {
        this.expensesPayed = getExpensesPayed() + expensesPayed;
    }

    public void addSalesReceivable(Double salesReceivable) {
        this.salesReceivable = getSalesReceivable() + salesReceivable;
    }

    public void addExpensePayable(Double expensesPayable) {
        this.expensesPayable = getExpensesPayable() + expensesPayable;
    }

    public Date getFinanceBalanceDate() {
        return financeBalanceDate;
    }

    public void setFinanceBalanceDate(Date financeBalanceDate) {
        this.financeBalanceDate = financeBalanceDate;
    }
}
